package com.syf.feign;

import com.syf.config.feign.OAuth2FeignConfig;
import com.syf.dto.UserBankDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 若FeignClient 里面的name 相同时,spring 创建对象就会报错:它认为它们2 个对象是一样的
 *  添加 contextId = "userBankServiceFeign" 给一个别名
 *
 */
@FeignClient(name = "member-service",contextId = "userBankServiceFeign" ,configuration = OAuth2FeignConfig.class ,path = "/userBanks")
public interface UserBankServiceFeign {

    /**
     * 根据 用户ID 查询银行卡信息【getOne】
     * @param userId
     * @return
     */
    @GetMapping("/{userId}/info")
    UserBankDto getUserBankInfo(@PathVariable Long userId) ;
}
